package cn.ruituo.web;

import cn.ruituo.util.LogUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author oldliu
 * @since 1.0
 */
//全局异常处理
@ControllerAdvice
public class ErrorHandler {

    //@Autowired
    //private RedisTemplate redisTemplate;
    @ExceptionHandler(Exception.class)

    public String handler(Exception e){
        LogUtil.error(e.getMessage(),e);
        return "forward:/error.jsp";

    }
}
